package syht;

import main.pak.R;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;

public class ViewAnimation extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_view_animation);
		
		final Button alphaButton = (Button) findViewById(R.id.alphaButton);
        final Button translateButton = (Button) findViewById(R.id.translateButton);
        final Button rotateButton = (Button) findViewById(R.id.rotateButton);
        final Button scaleButton = (Button) findViewById(R.id.scaleButton);
        final Button setButton = (Button) findViewById(R.id.setButton);
        
        //alpha
        Animation alpha_anim = AnimationUtils.loadAnimation(this, R.anim.alpha_anim);
        alphaButton.startAnimation(alpha_anim);
        
        //rotate
        Animation rotate_anim = AnimationUtils.loadAnimation(this, R.anim.rotate_anim);
        rotateButton.startAnimation(rotate_anim);
        
        //alpha
        Animation scale_anim = AnimationUtils.loadAnimation(this, R.anim.scale_anim);
        scaleButton.startAnimation(scale_anim);
        
        //alpha
        Animation translate_anim = AnimationUtils.loadAnimation(this, R.anim.translate_anim);
        translateButton.startAnimation(translate_anim);
        
        //set - Tong hop animation
        Animation set_anim = AnimationUtils.loadAnimation(this, R.anim.set_anim);
        setButton.startAnimation(set_anim);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.view_animation, menu);
		return true;
	}

}
